﻿<%@ Page Title="" Language="C#" MasterPageFile="~/管理员.Master" AutoEventWireup="true" CodeBehind="产品管理.aspx.cs" Inherits="TicketManagement.产品管理" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
    .auto-style3 {
        position: relative;
        left: 355px;
        top: 61px;
        width: 890px;
        height: 501px;
    }
        .auto-style4 {
            height: 544px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="auto-style4"> 
        
        <div align="center" vertical-align="center"   >
         </div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="inventoryNumber" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True" AutoGenerateEditButton="True" HorizontalAlign="Justify" PageSize="5" CssClass="auto-style3"   >
            <Columns>
                <asp:CommandField ShowDeleteButton="True" />
                <asp:BoundField DataField="inventoryNumber" HeaderText="inventoryNumber" ReadOnly="True" SortExpression="inventoryNumber" />
                <asp:BoundField DataField="productName" HeaderText="productName" SortExpression="productName" />
                <asp:BoundField DataField="productInventory" HeaderText="productInventory" SortExpression="productInventory" />
                <asp:BoundField DataField="productUnitPrice" HeaderText="productUnitPrice" SortExpression="productUnitPrice" />
            </Columns>
            <RowStyle HorizontalAlign="Center" />
        </asp:GridView>
           
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ticket_management_systemConnectionString %>" ProviderName="<%$ ConnectionStrings:ticket_management_systemConnectionString.ProviderName %>" SelectCommand="SELECT inventoryNumber, productName, productInventory, productUnitPrice FROM inventory" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [inventory] WHERE [inventoryNumber] = ? AND (([productName] = ?) OR ([productName] IS NULL AND ? IS NULL)) AND (([productInventory] = ?) OR ([productInventory] IS NULL AND ? IS NULL)) AND (([productUnitPrice] = ?) OR ([productUnitPrice] IS NULL AND ? IS NULL))" InsertCommand="INSERT INTO [inventory] ([inventoryNumber], [productName], [productInventory], [productUnitPrice]) VALUES (?, ?, ?, ?)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE inventory 
SET productName = ?, productInventory = ?, productUnitPrice = ? 
WHERE inventoryNumber = ? ">
            <DeleteParameters>
                <asp:Parameter Name="original_inventoryNumber" Type="Int32" />
                <asp:Parameter Name="original_productName" Type="String" />
                <asp:Parameter Name="original_productName" Type="String" />
                <asp:Parameter Name="original_productInventory" Type="Int32" />
                <asp:Parameter Name="original_productInventory" Type="Int32" />
                <asp:Parameter Name="original_productUnitPrice" Type="Int32" />
                <asp:Parameter Name="original_productUnitPrice" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="inventoryNumber" Type="Int32" />
                <asp:Parameter Name="productName" Type="String" />
                <asp:Parameter Name="productInventory" Type="Int32" />
                <asp:Parameter Name="productUnitPrice" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="productName" Type="String" />
                <asp:Parameter Name="productInventory" Type="Int32" />
                <asp:Parameter Name="productUnitPrice" Type="Int32" />
                <asp:Parameter Name="original_inventoryNumber" Type="Int32" />
                <asp:Parameter Name="original_productName" Type="String" />
                <asp:Parameter Name="original_productName" Type="String" />
                <asp:Parameter Name="original_productInventory" Type="Int32" />
                <asp:Parameter Name="original_productInventory" Type="Int32" />
                <asp:Parameter Name="original_productUnitPrice" Type="Int32" />
                <asp:Parameter Name="original_productUnitPrice" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>

        </div>
</asp:Content>
